#include "PKB.h"
#include "PTree.h"
#include "StmtTable.h"
#include <vector>

using namespace std;

class DesignExtractor{
private:
	PKB* pkb;
	Contains contains;
	Next next;
	NextBip nextBip;
	ProcTable _pc;
public:
	DesignExtractor();
	DesignExtractor(PKB*);
	void computeFollowsStar();
	void computeParentStar();
	void computeModifiesTable();
	void computeModifiesMap();
	void computeUsesTable();
	void computeUsesMatrix();
	void computeNext();
	void computeNextMatrix();
	void checkASTforNext(TNode*, int);
	bool checkChildrenDoneModifies(int n, vector<PTree> PMTable);
	bool checkChildrenDoneUses(int n, vector<PTree> PUTable);
	void computeCallsStarList();
	int getEnd(TNode*);
	void computeStmtTable();
	void computeAffectBipText();

	void computeNextBip();
	void computeNextBipMatrix();
	void checkASTforNextBip(TNode*, int);
	void computeProcTable();
	INDEX computeLastLine(INDEX proc, Calls ct);
	vector<TNode*> computeChildStar(TNode*);
	void computeContainsStar();
};